package com.zfzs.post.modules.lesson.service;

import com.zfzs.post.modules.lesson.domain.Lesson;
import com.zfzs.post.modules.lesson.service.dto.LessonDTO;
import com.zfzs.post.modules.lesson.service.dto.LessonQueryCriteria;
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* @author wq
* @date 2019-12-04
*/
//@CacheConfig(cacheNames = "lesson")
public interface LessonService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(LessonQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(LessonQueryCriteria criteria);

    /**
     * findById
     * @param lessonId
     * @return
     */
    //@Cacheable(key = "#p0")
    Lesson findById(Integer lessonId);

    /**
     * create
     * @param resources
     * @return
     */
    //@CacheEvict(allEntries = true)
    Lesson create(Lesson resources);

    /**
     * update
     * @param resources
     */
    //@CacheEvict(allEntries = true)
    void update(Lesson resources);

    /**
     * delete
     * @param lessonId
     */
    //@CacheEvict(allEntries = true)
    void delete(Integer lessonId);

    /**
     * 查1个
     * @param lesson
     * @return
     */
    Lesson findOne(Lesson lesson);

    /**
     * 查列表
     * @param lesson
     * @return
     */
    List<Lesson> findList(Lesson lesson);
}